home *** CD-ROM | disk | FTP | other *** search
/ Wildcat Files 2 / The Wildcat Files 2 (Arsenal Computer).ISO / qm-util / pcb-mm.scr < prev    next >
Text File  |  1994-04-02  |  9KB  |  174 lines

  1. ; This script will make an unattended mail run to pick up PCBoard MarkMail door
  2. ; mail and send any new mail waiting to be sent.  Make sure you edit DIALTXT,
  3. ; NAME, MAXTRIES, and TCLOGOFF in the DEFINITIONS section (leave UDONE and
  4. ; DDONE alone) to meet your requirements!  Add your NAME, Password, and the
  5. ; name of the BBS your calling in the DEFINITIONS section of the script.  Add
  6. ; the PCB Conference # and MarkMail door command to the MAIN BODY section.
  7. ;
  8. ; IMPORTANT: You must have HotKeys turned off and Expert mode turned on in
  9. ; your user profile on the BBS, and also make sure the packet name, .QWK 
  10. ; download path, and .REP upload path are defined in the FON book entry for
  11. ; the system you will be calling before using this script.
  12. ;
  13. ; Modified from the script listed in the QmodemPro 1.00 manual.  Then modified
  14. ; again for MarkMail.  Feel free to make any modifications you wish.  If you
  15. ; make it better, then share it with everyone else!
  16. ;
  17.  
  18. TurnOn  8_BIT
  19. TurnOff LINEFEED
  20. TurnOff XON/XOFF
  21. TurnOff NOISE
  22. TurnOff MUSIC
  23. TurnOn  SCROLL
  24. TurnOff PRINT
  25. TurnOff ECHO
  26. Capture MAILRUN.CAP
  27. Log     MAILRUN.LOG
  28. ;
  29. ; ------------------------ DEFINITIONS -------------------------
  30. ;
  31. String  NAME UDONE DDONE DOOR MAXTRIES FONTXT TCLOGOFF DIALTXT
  32. Assign  DIALTXT "Text From BBS dial entry" ; unique text string from FON file
  33. Assign  NAME    "First Last Password"   ; Name and Password on BBS
  34. Assign  UDONE   N                       ; Upload done?
  35. Assign  DDONE   N                       ; Download done?
  36. Assign  MAXTRIES 5                      ; Maximum attempts to connect
  37. Assign  TCLOGOFF N                      ; set this to Y if you have logoff
  38.                                         ; after upload set to Y in MarkMail,
  39.                                         ; N if you do not
  40. ;
  41. ; --------------------- END DEFINITIONS ------------------------
  42. ;
  43.  
  44. Restart:                                ; Go here if the connection gets
  45.                                         ; broken then stamp log
  46. Stamp NO CARRIER detected, restarting script
  47.  
  48. ; Notes:
  49. ; The DIAL command uses the ability to call a specific number, without
  50. ; knowing the exact position in the .FON file.  The example DIALTXT set up
  51. ; in this script will search the .FON file for the text "MSI HQ".  By using
  52. ; the Text dial option and specifying this, it will dial this number even
  53. ; if the FON book is sorted.  Note the 'T' prefix in the DIAL line below...
  54.  
  55. ;-----
  56. ; Dial section starts here
  57. ;-----
  58. Decr    MAXTRIES                        ; decrement the counter
  59. If      "$MAXTRIES" = "0" TooManyTries  ; if none left goto TooManyTries
  60. If      $ONLINE SkipDial                ; skip the dial if online already
  61. Dial    "T$DIALTXT"                     ; dial selected entry
  62. SkipDial:
  63. TimeOut 1200 OutOfTime                  ; set Waitfor timeout to 1200 seconds
  64. Goto    Top                             ; jump to start of main body
  65. OutOfTime:                              ; come here if something times out
  66. Hangup                                  ; hang up the phone
  67. Delay   5000                            ; wait 5 seconds
  68. Hangup                                  ; hang up again (just in case)
  69. Delay   5000                            ; wait 5 seconds
  70. Goto    Restart                         ; start over again
  71.  
  72. ;-----
  73. ; Main Body starts here
  74. ;-----
  75. Top:                                    ; label for main body of script
  76. When    "NO CARRIER" Restart            ; goto label restart if fails
  77. When    "left) (H)elp, More?" "^M"      ; Continue passed logon notices
  78. When    " (Enter)=no?" "^M"             ; Continue passed Language or 
  79. ;                                       ; Graphics questions.
  80. Waitfor "first name?"                   ; wait for first name prompt
  81. Delay   100                             ; delay .1 second
  82. Send    "$NAME^M"                       ; send text from Define section
  83. Waitfor "COMMAND?"                      ; Main menu prompt
  84. delay 100
  85. Send "Join 38^M"                        ; Join mail conf (Edit if needed)
  86. Waitfor "COMMAND?"
  87. delay 100
  88. Send "Door 1^M"                         ; Command to open MarkMail (Edit)
  89.  
  90. Waitfor "MarkMail Command?"             ; wait for the MarkMail menu prompt
  91.  
  92. ;-----
  93. CmdLoop:                                ; label for command loop
  94. If      "$DDONE" = "N" DoDownload       ; download not done, do it
  95. If      "$UDONE" = "N" DoUpload         ; upload not done, do it
  96. Goto AllDoneN                           ; only if both of above are done
  97.  
  98. ;-----
  99. DoDownload:                             ; label for download section
  100. When    "Sorry, No Messages Found..." DownloadOK ; go to label if no msgs
  101. ;                                                ; to download
  102. Send    "^M"                            ; send ENTER for check
  103. Waitfor "MarkMail Command?"             ; wait for menu again
  104. Delay   2000                            ; wait 2 seconds
  105. Send    "D^M"                           ; send D ENTER for download
  106. Waitfor "bye When Done?"                ; wait until packet is ready
  107. Delay   100                             ; delay .1 second
  108. Send    "Y^M"                           ; answer Y ENTER
  109. Waitfor "$PACKET.QWK"                   ; wait until it's ready to send
  110. Stamp   Beginning download of $QWKPATH$PACKET.QWK ; stamp log
  111. Download Z $QWKPATH$PACKET.QWK          ; start the download
  112. If      $SUCCESS DownloadOK             ; if ok, branch to label
  113. Stamp   Download FAILED                 ; make note in log that it failed
  114. Goto    DoDownload                      ; and do it again
  115.  
  116. ;-----
  117. DownloadOK:                             ; label for OK downloads
  118. Stamp   Download successful or no mail found ; make note in log of what happened
  119. Assign  DDONE Y                         ; change download flag to Y
  120. Goto    CmdLoop                         ; branch back to Command Loop
  121.  
  122. ;-----
  123. DoUpload:                               ; label for upload section
  124. Delay   2000                            ; wait for 2 seconds
  125. Send    "^M"                            ; send ENTER key
  126. Waitfor "MarkMail Command?"             ; wait for MarkMail menu prompt
  127. Delay   100                             ; wait .1 second
  128. Exist   $REPPATH$PACKET.REP SendMsgs    ; if there are messages to send then
  129.                                         ; goto SendMsgs
  130. Assign  UDONE Y                         ; if no messages to send, flag that
  131.                                         ; uploading is done
  132. Goto    CmdLoop                         ; and branch back to Command Loop
  133.  
  134. ;-----
  135. SendMsgs:                               ; label for SendMsgs section
  136. Send    "U^M"                           ; send U ENTER
  137. Waitfor "$PACKET.REP"                   ; wait until MarkMail is ready
  138. Pause   1000                            ; wait 1 second
  139. Upload  Z $REPPATH$PACKET.REP           ; start the upload
  140. If      $FAIL DoUpload                  ; if not OK then do it again
  141. ;DeleteF $REPPATH$PACKET.REP            ; delete the .rep file
  142. ;If      "$TCLOGOFF" = "Y" AllDoneY     ; if MarMail set to logoff after upload
  143.                                         ; branch to AllDoneY
  144. Assign  UDONE Y                         ; set upload flag to Y
  145.  
  146. ;-----
  147. AllDoneN:                               ; label when up and downloads are done
  148. When                                    ; cancels all previous When tracking
  149. Send    "^M"                            ; send ENTER
  150. Waitfor "MarkMail Command?"             ; wait for menu
  151. Send    "G^M"                           ; send G ENTER to logoff
  152. Goto    EndGame                         ; branch to EndGame label
  153.  
  154. ;-----
  155. AllDoneY:
  156. When                                    ; stop tracking all previous WHENs
  157. When    "Auto Logoff" "H^M"             ; send H ENTER to logoff
  158. Assign  UDONE Y                         ; set the upload done flag
  159.  
  160. ;-----
  161. EndGame:                                ; label for end of script
  162. Hangup                                  ; hangup the modem
  163. Delay   2000                            ; wait 2 seconds
  164. Send    "ATM0H1^M"                      ; take modem offhook
  165. TurnOff Log                             ; close the log file
  166. System  Y                               ; exit back to DOS
  167. Exit                                    ; end of script (if successful)
  168.  
  169. ;-----
  170. TooManyTries:
  171. Stamp   "Mail attempt failed..."        ; place notice in log file
  172. TurnOff Log                             ; close the log file
  173. Exit                                    ; end of script (if failure)
  174.